@extends('admin.layout.index')
@section('header','话题修改')<!-- 视图 -->
@section('con')

<!-- /.panel(开始) -->
<div class="col-lg-12">
    <div class="panel panel-default">
        <div class="panel-heading">
            <a href="/admin/topic/index"><-返回上一级</a>
        </div>
        <!-- /.panel-body(开始) -->
        <div class="panel-body">
            <!-- /.row (开始) -->
            <div class="row">
            <!-- 验证 开始 -->
            @if(count($errors) > 0)
                <div class="alert alert-danger">
                    <ul>
                        @foreach($errors->all() as $error)
                            <li>{{$error}}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
            <!-- 验证 结束 -->
                <!-- /.col-lg-6 (开始) -->
                <div class="col-lg-5 col-lg-offset-3">
                    @foreach($res as $k=>$v)
                    <form role="form" method="post" action="{{url('/admin/topic/update')}}"enctype="multipart/form-data">
                        <input type="hidden"name="id"value="{{$v->id}}">
                        <div class="form-group">
                            <label>话题名:</label>
                            <input class="form-control"type="text" name="title"  value="{{$v->title}}"><span> </span>
                        </div>
                        <div class="form-group">
                            <label>描述:</label>
                            <input class="form-control" type="textarea" name="content" value="{{$v->content}}"><span></span>
                        </div>
                        <div class="form-group">
                            <label>头像上传</label>
                            <input type="file" name="pic" value=""><span></span>
                        </div>
                       {{ csrf_field() }} 
                        <button type="submit" class="btn btn-default">提交</button>
                    </form>
                    @endforeach
                </div>
                <!-- /.col-lg-6 (结束) -->
            </div>
            <!-- /.row (结束) -->
        </div>
        <!-- /.panel-body(结束) -->
    </div>
    <!-- /.panel(结束) -->
</div>

@endsection